{extend name="Public:public_template" /}
{block name="container"}
<script type="text/javascript">
    $(function () {
        var updateparameterurl = "{:url('publicclass/updateparameter')}";
        var model_field_id = "{$model_field_id}";
        admin.updatetypename("{$findservice['type_name']}", model_field_id, updateparameterurl);
        $('.type_name').change(function () {
            var typenamevalue = $(this).val();
            admin.updatetypename(typenamevalue, model_field_id, updateparameterurl);
        })
    });
</script>
<div class="main-container">
    <div class="current-location">
        {include file="public/current_location" /}
    </div>
    <div class="content-container">
        <form action="" method="post">
            <input type="hidden" name="__token__" value="{$Request.token}"/>
            <input type="hidden" name="where[model_field_id]" value="{$findservice['model_field_id']}" />
            <input type="hidden" name="modelwhere[model_table_id]" value="{$findservice['model_table_id']}" />
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td class="td-width-25">模型管理：</td>
                    <td class="text-align">{$tablefindservice['table_name']}字段管理</td>
                </tr>
                <tr>
                    <td class="td-width-15">字段类型：</td>
                    <td class="text-align">
                        <select class="type_name" name="info[type_name]">
                            <option value="">请选择字段类型</option>
                            {volist name='updatefieldlist' id='vo'}
                            <option value="{$vo['name']}" {if condition="$vo['name'] eq $findservice['type_name']"} selected {/if} >{$vo['title']}</option>
                            {/volist}
                        </select>
                        <span class="red">*</span>
                    </td>
                </tr>
                <tr>
                    <td class="td-width-15">字段名称：</td>
                    <td class="text-align"><input type="text" name="info[title]" value="{$findservice['title']}" placeholder="请输入字段名称"/><span class="red">*</span></td>
                </tr>
                <tr>
                    <td class="td-width-15">字段名：</td>
                    <td class="text-align"><input type="text" {if condition="$findservice['is_system'] eq 1 || $findservice['is_index'] eq 1"} readonly {/if} name="info[field]" value="{$findservice['field']}" placeholder="请输入字段名"/><span class="red">*</span></td>
                </tr>
                <tr>
                    <td class="td-width-15">相关参数：</td>
                    <td class="text-align">
                        <div class="setting-container" style="padding: 10px 0 10px 10px;"></div>
                    </td>
                </tr>
                <tr>
                    <td class="td-width-15">字段描述：</td>
                    <td class="text-align"><input type="text" name="info[comment]" value="{$findservice['comment']}" placeholder="请输入字段描述"/></td>
                </tr>
                <tr>
                    <td class="td-width-25">数据校验正则：
                        <p style="line-height: 20px;">系统将通过此正则校验表单提交的数据合法性，如果不想校验数据请留空</p>
                    </td>
                    <td class="text-align"><input type="text" name="info[pattern]" value="{$findservice['pattern']}" id="pattern" placeholder="请输入数据校验正则"/>
                        <select name="pattern_select" style="margin-left: 20px;" onchange="javascript:$('#pattern').val(this.value)">
                            <option value="">常用正则</option>
                            <option value="/^[0-9.-]+$/">数字</option>
                            <option value="/^[0-9-]+$/">整数</option>
                            <option value="/^[a-z]+$/i">字母</option>
                            <option value="/^[0-9a-z]+$/i">数字+字母</option>
                            <option value="/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/">E-mail</option>
                            <option value="/^[0-9]{5,20}$/">QQ</option>
                            <option value="/^http:\/\//">超级链接</option>
                            <option value="/^(1)[0-9]{10}$/">手机号码</option>
                            <option value="/^[0-9-]{6,13}$/">电话号码</option>
                            <option value="/^[0-9]{6}$/">邮政编码</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="td-width-25">数据校验未通过的提示信息	：</td>
                    <td class="text-align"><input type="text" name="info[errortips]" value="{$findservice['errortips']}" placeholder="请输入数据校验未通过的提示信息"/></td>
                </tr>
                <tr>
                    <td class="td-width-15">Input样式：</td>
                    <td class="text-align"><input type="text" name="info[class_name]" value="{$findservice['class_name']}" placeholder="请输入Input样式"/></td>
                </tr>
                <tr>
                    <td class="td-width-15">排序：</td>
                    <td class="text-align"><input type="text" name="info[list_order]" value="{$findservice['list_order']}" placeholder="请输入排序" class="list-order"/></td>
                </tr>
                <tr>
                    <td class="td-width-15">是否显示：</td>
                    <td class="text-align">
                        <label><input type="radio" name="info[is_show]" {if condition="$findservice['is_show'] eq 1"} checked {/if} value="1"/>显示</label>
                        <label class="radio-left"><input type="radio" name="info[is_show]" {if condition="$findservice['is_show'] eq 0"} checked {/if} value="0"/>隐藏</label>
                    </td>
                </tr>
                <tr>
                    <td class="td-width-15">是否为空：</td>
                    <td class="text-align">
                        <label><input type="radio" name="info[is_null]" {if condition="$findservice['is_null'] eq 0"} checked {/if} value="0"/>是</label>
                        <label class="radio-left"><input type="radio" name="info[is_null]" {if condition="$findservice['is_null'] eq 1"} checked {/if} value="1"/>否</label>
                    </td>
                </tr>
                <tr>
                    <td class="td-width-15">是否为系统字段：</td>
                    <td class="text-align">
                        <label><input type="radio" name="info[is_system]" {if condition="$findservice['is_system'] eq 1"} disabled {/if} {if condition="$findservice['is_system'] eq 1"} checked {/if} value="1"/>是</label>
                        <label class="radio-left"><input type="radio" name="info[is_system]" {if condition="$findservice['is_system'] eq 1"} disabled {/if} {if condition="$findservice['is_system'] eq 0"} checked {/if} value="0"/>否</label>
                    </td>
                </tr>
                <tr>
                    <td class="td-width-15">是否可以删除：</td>
                    <td class="text-align">
                        <label><input type="radio" name="info[is_delete]" {if condition="$findservice['is_delete'] eq 1"} checked {/if} value="1"/>否</label>
                        <label class="radio-left"><input type="radio" {if condition="$findservice['is_delete'] eq 0"} checked {/if} name="info[is_delete]" value="0"/>是</label>
                    </td>
                </tr>
            </table>
            <div class="submit-button-form">
                <input type="submit" name="submit" value="提交数据">
            </div>
        </form>
    </div>
</div>
{/block}